package com.wushi.lenovo.asia5b.app_di.credit.presenter;

import com.mvp.base.BasePresenter;
import com.wushi.lenovo.asia5b.app_di.credit.mvpview.AtmFragmentView;
import com.wushi.lenovo.asia5b.app_http.ApiService;
import com.wushi.lenovo.asia5b.app_model.other.UserInfo;

import java.util.Map;

import javax.inject.Inject;


/**
 * Created by zhangyuncai on 2019/1/21.
 */
public class AtmFragmentPresenter extends BasePresenter<AtmFragmentView> {

    ApiService apiService;

    @Inject
    public AtmFragmentPresenter(ApiService apiService) {
        this.apiService = apiService;
    }

    /**
     *  汇款银行
     */
    public void getToBanks() {
        baseSubscribe(apiService.getBanks(UserInfo.getMemberId()), listResultModel -> {
            getView().getToBanksResult(listResultModel);
        });
    }

    /**
     * 被汇款银行
     */
    public void getFromBanks() {
        baseSubscribe(apiService.getWithdrawBanks(UserInfo.getCountryId()), listResultModel -> {
            getView().getFromBanksResult(listResultModel);
        });
    }

    public void submit(Map<String, Object> map) {
        baseSubscribe(apiService.topupByAtm(map), resultModel -> {
            getView().submitResult(resultModel);
        });
    }

    public void upload() {
    }
}